package com.itheima.array;

import java.util.ArrayList;

public class spring {
    public static void main(String[] args) {
        ArrayList<Student>list =new ArrayList<>();
        Student stu1 =new Student("凤姐",26);
        Student stu2 =new Student("平儿",19);
        Student stu3 =new Student("妙玉",24);
        list.add(stu1);
        list.add(stu2);
        list.add(stu3);
        for (int i = 0; i < list.size(); i++) {
            Student  stu=list.get(i);
            System.out.println(stu.getName()+"年方"+stu.getAge());
        }

    }


}
